<ui:composition xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<p:dialog closeOnEscape="true" header="#{msgs.hierarchyCreation}" id="dialogHierarchyCreation" modal="true" resizable="false" widgetVar="dialogHierarchyCreationVar" width="360">
		<h:form id="hierarchyCreationForm">
			<p:outputPanel id="existingHierarchy" layout="block" rendered="#{hierarchiesController.checkExistingHierarchy}" styleClass="errorMessage">
				<h:outputText value="#{msgs.hierarchyExisting}" />
			</p:outputPanel>
			<h:panelGrid columns="3" id="inputGrid">
				<h:outputText value="#{msgs.project}*: "/>
				<h:selectOneMenu id="inputProject" required="true" value="#{hierarchiesController.hierarchyToCreate.project.projectId}">
					<f:selectItems value="#{hierarchiesController.projects}"/>
				</h:selectOneMenu>
				<p:message display="icon" for="inputProject" />
				<h:outputText value="#{msgs.version}*: "/>
				<h:selectOneMenu id="inputVersion" required="true" value="#{hierarchiesController.hierarchyToCreate.version.versionId}">
					<f:selectItems value="#{hierarchiesController.versions}"/>
				</h:selectOneMenu>
				<p:message display="icon" for="inputVersion" />
				<h:outputText value="#{msgs.responsable}*: "/>
				<h:selectOneMenu id="inputResponsable" required="true" value="#{hierarchiesController.hierarchyToCreate.user.userId}">
					<f:selectItems value="#{hierarchiesController.responsableUsers}"/>
				</h:selectOneMenu>
				<p:message display="icon" for="inputResponsable" />
				<h:outputText value="#{msgs.highLevelGoal}*: "/>
				<p:inputText id="inputGoal" required="true" value="#{hierarchiesController.hierarchyToCreate.highLevelGoal}"/>
				<p:message display="icon" for="inputGoal" />
			</h:panelGrid>
			<p:outputPanel layout="block" styleClass="buttonContainer center">
				<p:commandButton actionListener="#{hierarchiesController.createHierarchy}" ajax="true" image="ui-icon ui-icon-circle-plus" oncomplete="handleSaveRequest(xhr, status, args, dialogHierarchyCreationVar)" type="submit" update="hierarchyCreationForm" value="#{msgs.create}"/>
				<p:commandButton image="ui-icon ui-icon-circle-close" onclick="dialogHierarchyCreationVar.hide()" type="button" value="#{msgs.cancel}"/>
			</p:outputPanel>
		</h:form>
	</p:dialog>
</ui:composition>